package org.cshoo.sys.business
{
	import hessian.client.HessianService;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	
	import org.cshoo.common.business.ServiceLocator;
	import org.cshoo.sys.model.vo.Role;
	
	public class RoleDelegate
	{
		public var serviceLocator:ServiceLocator = ServiceLocator.getInstance();
		
		public var _service:HessianService;
		
		private var _responder:IResponder;
		
		public function RoleDelegate(responder:IResponder)
		{
			_service = serviceLocator.roleService;
			this._responder = responder;
		}
		
		public function findRoleList(roleExample:Role){
			var asyncToken:AsyncToken　=　_service.getOperation("findRoleList").send(roleExample);
			asyncToken.addResponder(_responder);
		}
		
		public function addRole(role:Role){
			var asyncToken:AsyncToken　=　_service.getOperation("addRole").send(role);
			asyncToken.addResponder(_responder);
		}
		
		public function updateRole(role:Role){
			var asyncToken:AsyncToken　=　_service.getOperation("updateRole").send(role);
			asyncToken.addResponder(_responder);
		}
		
		public function deleteRole(role:Role){
			var asyncToken:AsyncToken　=　_service.getOperation("deleteRole").send(role);
			asyncToken.addResponder(_responder);
		}
	}
}